package yxy.banana.server.internal;

import io.netty.channel.socket.nio.NioSocketChannel;
import io.netty.handler.logging.LogLevel;
import io.netty.handler.ssl.SslContext;
import yxy.apple.nio.Coder;
import yxy.apple.nio.Initializer;
import yxy.banana.socket.coder.ProtobufCoder;

public abstract class InternalInitializer extends Initializer {
	@Override
	protected LogLevel provideLogLevel(NioSocketChannel channel) throws Exception {
		return LogLevel.TRACE;
	}

	@Override
	protected SslContext provideSslContext(NioSocketChannel channel) throws Exception {
		// 内部网络不需要SSL
		return null;
	}

	@Override
	protected Coder provideCoder(NioSocketChannel channel) throws Exception {
		// 内部网络全部使用ProtobufCoder
		return new ProtobufCoder();
	}
}
